package com.java.test.user.dto;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

/**
 * 登陆用户
 * 
 * @author tdong
 *
 */
public class UserInfo implements RowMapper<UserInfo> {

	// 主键id
	private int id;

	// 用户名
	private String username;

	// 用户密码
	private String password;

	// 创建时间
	private String createTime;
	
	// ip地址
	private String ipAddress;
	
	

	public UserInfo() {
		super();
	}

	public UserInfo(int id, String userName, String userPassword, String createTime) {
		super();
		this.id = id;
		this.username = userName;
		this.password = userPassword;
		this.createTime = createTime;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	
	
	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public UserInfo mapRow(ResultSet rs, int rowNum) throws SQLException {
		UserInfo info = new UserInfo();
		info.setId(rs.getInt("id"));
		info.setUsername(rs.getString("user_name"));
		info.setPassword(rs.getString("password"));
		info.setCreateTime(rs.getString("create_time"));
		return info;

	}

}
